<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class UserPermission extends Model
{
    use HasFactory;

    /**
     * 指定表名
     *
     * @var string
     */
    protected $table = 'user_permissions';

    /**
     * 可批量赋值的属性
     *
     * @var array
     */
    protected $fillable = [
        'id',
        'remarks'
    ];

    /**
     * 获取具有此权限的用户
     */
    public function users()
    {
        return $this->hasMany(User::class, 'attribute_id', 'id');
    }
} 